package com.gl.admin.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
/**
 * 风格
 */
public class Result {

    private Integer code;
    private String msg;
    private Boolean success;
    private Object data;

    public static Result success() {
        return new Result(HttpsStatus.CODE_200,"成功",true,null);
    }
    public static Result success(String message, Object data) {
        return new Result(HttpsStatus.CODE_200,message,true,data);
    }
    public static Result success(Object data) {
        return new Result(HttpsStatus.CODE_200,"成功",true,data);
    }
    public static Result error(Integer code, String message) {
        return new Result(code,message,false,null);
    }
    public static Result error() {
        return new Result(HttpsStatus.CODE_500,"系统错误",false,null);
    }

}
